From a04a1a1dc78ddbaceee558d0811f1fe9787b8c3d Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Fri, 21 Oct 2005 13:30:31 +0100 Subject: [PATCH] Break proc paths out into separate include file, rather than inlining them. Signed-off-by: Ewan Mellor --- tools/xenstore/xenstored_domain.c | 5 +++-- tools/xenstore/xenstored_proc.h | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 tools/xenstore/xenstored_proc.h diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index fd2bbdf691..69e429ccfa 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -33,6 +33,7 @@ #include "talloc.h" #include "xenstored_core.h" #include "xenstored_domain.h" +#include "xenstored_proc.h" #include "xenstored_watch.h" #include "xenstored_test.h" @@ -449,7 +450,7 @@ static int dom0_init(void) char str[20]; struct domain *dom0; - fd = open("/proc/xen/xsd_mfn", O_RDONLY); + fd = open(XENSTORED_PROC_MFN, O_RDONLY); rc = read(fd, str, sizeof(str)); str[rc] = '\0'; @@ -457,7 +458,7 @@ static int dom0_init(void) close(fd); - fd = open("/proc/xen/xsd_port", O_RDONLY); + fd = open(XENSTORED_PROC_PORT, O_RDONLY); rc = read(fd, str, sizeof(str)); str[rc] = '\0'; diff --git a/tools/xenstore/xenstored_proc.h b/tools/xenstore/xenstored_proc.h new file mode 100644 index 0000000000..d065b05894 --- /dev/null +++ b/tools/xenstore/xenstored_proc.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2005 XenSource Ltd + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#ifndef _XENSTORED_PROC_H +#define _XENSTORED_PROC_H + +#define XENSTORED_PROC_MFN "/proc/xen/xsd_mfn" +#define XENSTORED_PROC_PORT "/proc/xen/xsd_port" + + +#endif /* _XENSTORED_PROC_H */ -- 2.30.2